<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    var momo = {x: '男', y: '女'};
    var list = [{
      age: '29',
      id: 0,
      name: '马云',
      gender: '男'
    }, ]

    var keys = [{
      key: 'id',
      compute(id) {
        return id + 1;
      }
    }, 'age', 'name', {
      key: 'gender',
      compute(gender) {
        momo[gender]
      }
    }];

    keys.forEach((item) => {
      console.log(list[0][item])
    })
  </script>

</body>

</html>